  //轮播图
  var mySwiper = new Swiper ('.swiper-container', {
    // direction: 'vertical', // 垂直切换选项
    autoplay:{
      StopOnLast:true,
    },
    
    loop: true, // 循环模式选项
    
    // 如果需要分页器
    pagination: {
      el: '.swiper-pagination',
      // type:'custom',
    },
    
    // 如果需要前进后退按钮
    navigation: {
      nextEl: '.swiper-button-next',
      prevEl: '.swiper-button-prev',
      hideOnClick: true,
    },
    
    // 如果需要滚动条
    // scrollbar: {
    //   el: '.swiper-scrollbar',
    //   dragSize: 60,
    // },
  })   

// 商品列表
loadList()
loadList1()
loadList2()
loadList3()
loadList4()
async function loadList(){
  let pagenum = 0;
  let pagesize = 8;
  let uid = 55842;
  let hot = document.querySelector(".hot");

  let {data} = await axios.get(productListAPI,{
    params:{pagenum,pagesize,uid},
  });
  console.log(data);
  let resArr = data.data.map((v) =>
    `
    <li>
        <a href="./html/item.html?id=${v.pid}"><img src="${v.pimg}" alt=""></a>
        <p class="price">￥<span>${v.pprice}</span></p>
        <p class="name"><a href="./html/item.html?id=${v.pid}">${v.pname}</a></p>
    </li>
    `
  );
  hot.innerHTML = resArr.join("");
  // girl.innerHTML = resArr.join("");
}
async function loadList1(){
  let pagenum = 1;
  let pagesize = 8;
  let uid = 55842;
  let girl = document.querySelector(".girl");

  let {data} = await axios.get(productListAPI,{
    params:{pagenum,pagesize,uid},
  });
  console.log(data);
  let resArr = data.data.map((v) =>
    `
    <li>
        <a href="./html/item.html?id=${v.pid}"><img src="${v.pimg}" alt=""></a>
        <p class="price">￥<span>${v.pprice}</span></p>
        <p class="name"><a href="./html/item.html?id=${v.pid}">${v.pname}</a></p>
    </li>
    `
  );
  girl.innerHTML = resArr.join("");
}
async function loadList2(){
  let pagenum = 2;
  let pagesize = 8;
  let uid = 55842;
  let boy = document.querySelector(".boy");

  let {data} = await axios.get(productListAPI,{
    params:{pagenum,pagesize,uid},
  });
  console.log(data);
  let resArr = data.data.map((v) =>
    `
    <li>
        <a href="./html/item.html?id=${v.pid}"><img src="${v.pimg}" alt=""></a>
        <p class="price">￥<span>${v.pprice}</span></p>
        <p class="name"><a href="./html/item.html?id=${v.pid}">${v.pname}</a></p>
    </li>
    `
  );
  boy.innerHTML = resArr.join("");
}
async function loadList3(){
  let pagenum = 3;
  let pagesize = 8;
  let uid = 55842;
  let element = document.querySelector(".element");

  let {data} = await axios.get(productListAPI,{
    params:{pagenum,pagesize,uid},
  });
  console.log(data);
  let resArr = data.data.map((v) =>
    `
    <li>
        <a href="./html/item.html?id=${v.pid}"><img src="${v.pimg}" alt=""></a>
        <p class="price">￥<span>${v.pprice}</span></p>
        <p class="name"><a href="./html/item.html?id=${v.pid}">${v.pname}</a></p>
    </li>
    `
  );
  element.innerHTML = resArr.join("");
}
async function loadList4(){
  let pagenum = 4;
  let pagesize = 8;
  let uid = 55842;
  let acc = document.querySelector(".acc");

  let {data} = await axios.get(productListAPI,{
    params:{pagenum,pagesize,uid},
  });
  console.log(data);
  let resArr = data.data.map((v) =>
    `
    <li>
        <a href="./html/item.html?id=${v.pid}"><img src="${v.pimg}" alt=""></a>
        <p class="price">￥<span>${v.pprice}</span></p>
        <p class="name"><a href="./html/item.html?id=${v.pid}">${v.pname}</a></p>
    </li>
    `
  );
  acc.innerHTML = resArr.join("");
}
  